import request from '@/utils/request'

/** 维修管理*/
//新增报修
export function reportRepairAdd(params) {
    return request({
      url: '/device/reportForRepair',
      method: 'post',
      data:params,
    })
}
//首页列表+我的维修+我的验收
export function reportRepairList(params) {
    return request({
      url: '/device/reportForRepair/list',
      method: 'get',
      params,
    })
}
//分派（转派,接单）
export function reportRepairChange(params) {
    return request({
      url: `/device/reportForRepair?oddNumber=${params.oddNumber}&responsibleUserId=${params.responsibleUserId}&type=${params.type}`,
      method: 'put',
      data:params,
    })
}
//详情(处理)
export function reportRepairDes(id) {
    return request({
      url: `/device/reportForRepair/dto/${id}`,
      method: 'get',
    })
}
//详情(查看)
export function reportRepairDess(id) {
    return request({
      url: `/device/reportForRepair/${id}`,
      method: 'get',
    })
}
//故障类型列表
export function faultTypeList() {
  return request({
    url: `/device/faultType/list`,
    method: 'get',
  })
}
//验收
export function reportForRepairSure(params) {
  return request({
    url: `/device/reportForRepair/examination`,
    method: 'put',
    data:params
  })
}
//导出列表
export function reportForRepairExport() {
  return request({
    url: `/device/reportForRepair/export`,
    method: 'get',
  })
}
//撤销
export function reportForRepairRevoke(id,params) {
  return request({
    url: `/device/reportForRepair/${id}`,
    method: 'put',
    data:params
  })
}
//添加维修记录
export function repairHistroyAdd(params) {
  return request({
    url: `/device/reportForRepair/record`,
    method: 'post',
    data:params
  })
}





/***外委维修***/
//列表查询
export function repairList(params) {
  return request({
    url: `/device/qutsourcedMaintenance/list`,
    method: 'get',
    params
  })
}
//新增
export function repairAdd(params) {
  return request({
    url: `/device/qutsourcedMaintenance/add`,
    method: 'post',
    data:params
  })
}
//详情
export function repairDes(id) {
  return request({
    url: `/device/qutsourcedMaintenance/${id}`,
    method: 'get',
  })
}
//修改
export function repairEdit(params) {
  return request({
    url: `/device/qutsourcedMaintenance`,
    method: 'put',
    data:params
  })
}
//根据设备编号查询报修单信息
export function repairxunList(params) {
  return request({
    url: `/device/qutsourcedMaintenance/listAll`,
    method: 'get',
    params
  })
}
//打回
export function repairBack(id) {
  return request({
    url: `/device/qutsourcedMaintenance/${id}`,
    method: 'put',
  })
}
//删除
export function repairDel(id) {
  return request({
    url: `/device/qutsourcedMaintenance/${id}`,
    method: 'delete',
  })
}
//查询实施人员列表
export function reportForRepair(id) {
  return request({
    url: `/device/reportForRepair?responsibilityId=device003-03&repairId=${id}`,
    method: 'get',
  })
}
//查询维修记录详细信息
export function recordListDes(id) {
  return request({
    url: `/device/reportForRepair/getRecordList/${id}`,
    method: 'get',
  })
}
//查询耗材对比
export function maintenRecord(id) {
  return request({
    url: `/device/maintenanceRecord/${id}`,
    method: 'get',
  })
}

//外委审批
export function approve(params) {
  return request({
    url: `/device/qutsourcedMaintenance-approve/complete`,
    method: 'post',
    data:params
  })
}
//我的已办
export function taskDoneList(params) {
  return request({
    url: `/device/qutsourcedMaintenance-approve/taskDoneList`,
    method: 'get',
    params
  })
}
//我的待办
export function taskList(params) {
  return request({
    url: `/device/qutsourcedMaintenance-approve/taskList`,
    method: 'get',
    params
  })
}
//查询审批详细流程
export function approveList(moduleId) {
  return request({
    url: `/device/qutsourcedMaintenance-approve/${moduleId}`,
    method: 'get'
    
  })
}
//外委验收
export function wwwxForRepairSure(params) {
  return request({
    url: `/device/qutsourcedMaintenance/CheckAndAccept`,
    method: 'put',
    data:params
  })
}
//外委修改支付状态
export function wwwxUpdataPayment(params) {
  return request({
    url: `/device/qutsourcedMaintenance/updatePaymentState`,
    method: 'put',
    data:params
  })
}